.class public Lcom/instagram/android/service/o;
.super Ljava/lang/Object;
.source "PendingMediaServiceHelper.java"


# instance fields
.field private final a:Landroid/content/Context;

.field private volatile b:Ljava/util/concurrent/CountDownLatch;

.field private volatile c:Lcom/instagram/android/service/PendingMediaService;

.field private d:Landroid/content/ServiceConnection;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 47
    new-instance v0, Lcom/instagram/android/service/p;

    invoke-direct {v0, p0}, Lcom/instagram/android/service/p;-><init>(Lcom/instagram/android/service/o;)V

    iput-object v0, p0, Lcom/instagram/android/service/o;->d:Landroid/content/ServiceConnection;

    .line 24
    iput-object p1, p0, Lcom/instagram/android/service/o;->a:Landroid/content/Context;

    .line 25
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/service/o;Lcom/instagram/android/service/PendingMediaService;)Lcom/instagram/android/service/PendingMediaService;
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 15
    iput-object p1, p0, Lcom/instagram/android/service/o;->c:Lcom/instagram/android/service/PendingMediaService;

    return-object p1
.end method

.method static synthetic a(Lcom/instagram/android/service/o;)Ljava/util/concurrent/CountDownLatch;
    .locals 1
    .parameter

    .prologue
    .line 15
    iget-object v0, p0, Lcom/instagram/android/service/o;->b:Ljava/util/concurrent/CountDownLatch;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 28
    new-instance v0, Ljava/util/concurrent/CountDownLatch;

    invoke-direct {v0, v3}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V

    iput-object v0, p0, Lcom/instagram/android/service/o;->b:Ljava/util/concurrent/CountDownLatch;

    .line 30
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/instagram/android/service/o;->a:Landroid/content/Context;

    const-class v2, Lcom/instagram/android/service/PendingMediaService;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 31
    iget-object v1, p0, Lcom/instagram/android/service/o;->a:Landroid/content/Context;

    iget-object v2, p0, Lcom/instagram/android/service/o;->d:Landroid/content/ServiceConnection;

    invoke-virtual {v1, v0, v2, v3}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    .line 34
    :try_start_0
    iget-object v0, p0, Lcom/instagram/android/service/o;->b:Ljava/util/concurrent/CountDownLatch;

    invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->await()V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 39
    :goto_0
    const-string v0, "PendingMediaServiceHelper"

    const-string v1, "Cancelling old renders"

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 40
    iget-object v0, p0, Lcom/instagram/android/service/o;->c:Lcom/instagram/android/service/PendingMediaService;

    invoke-virtual {v0}, Lcom/instagram/android/service/PendingMediaService;->b()V

    .line 41
    iget-object v0, p0, Lcom/instagram/android/service/o;->c:Lcom/instagram/android/service/PendingMediaService;

    invoke-virtual {v0}, Lcom/instagram/android/service/PendingMediaService;->c()V

    .line 42
    iget-object v0, p0, Lcom/instagram/android/service/o;->a:Landroid/content/Context;

    iget-object v1, p0, Lcom/instagram/android/service/o;->d:Landroid/content/ServiceConnection;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V

    .line 44
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/instagram/android/service/o;->b:Ljava/util/concurrent/CountDownLatch;

    .line 45
    return-void

    .line 35
    :catch_0
    move-exception v0

    goto :goto_0
.end method
